<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数学对象下的拓展方法</title>
    <style>
        *{margin: 0;padding: 0;list-style-type: none;}
    </style>
</head>
<body>
    <script>
        /*
            数学对象下的方法/api
        */

        //获取0-1之间的随机数
        console.log(Math.random());
        console.log(Number.parseInt(Math.random()*10));//随机获取0-10之间是数

        //ceil 向上取整
        console.log(Math.ceil(6.7));
        //floor 向下取整
        console.log(Math.floor(5.9));
        //round 四舍五入
        console.log(Math.round(5.4));

        //比较最大值
        console.log(Math.max());
        //比较最小值
        console.log(Math.min());
        //Π
        console.log(Math.PI);
        //指数
        console.log(Math.pow(2,3));
        console.log(2**3);// ** 指数运算符
        
    </script>
</body>
</html>